package com.ld.shieldsb.common.core.util;

public class TypeUtil {

    public static int majorJavaVersion = 15;
    static {
        String javaVersion = System.getProperty("java.version");
        // version String should look like "1.4.2_10"
        if (javaVersion.contains("1.9.")) {
            majorJavaVersion = 19;
        } else if (javaVersion.contains("1.8.")) {
            majorJavaVersion = 18;
        } else if (javaVersion.contains("1.7.")) {
            majorJavaVersion = 17;
        } else if (javaVersion.contains("1.6.")) {
            majorJavaVersion = 16;
        } else {
            // else leave 1.5 as default (it's either 1.5 or unknown)
            majorJavaVersion = 15;
        }
    }

    public static boolean isGeJdk8() {
        return majorJavaVersion >= 18;
    }

}
